import React, { PureComponent, Fragment, Component } from 'react';
import { connect } from 'dva';
import moment from 'moment';
import {
  Card,
  Form,
  Button,
  Modal,
  message
} from 'antd';
const { confirm } = Modal;
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
@connect(({ order, loading, customer }) => ({

}))
@Form.create()
class UserModel extends Component {
  constructor(props) {
    super(props);
    this.state = {

    }
  }
  componentWillMount() {

  }
  resetOrderModal = () => {
    const { dispatch } = this.props;
    confirm({
      title: '重要提醒',
      content: '重置后，所有月结用户的"不再弹窗"设置将初始化，确定继续吗？',
      cancelText: '取消',
      okText: '确定',
      onOk() {
        dispatch({
          type: 'order/resetOrderModal'
        }).then((res) => {
          console.log(res)
          message.success('操作成功')
        })
      },
      onCancel() {
        console.log('Cancel');
      },
    });

  }
  render() {
    const layout = {
      labelCol: { span: 8 },
      wrapperCol: { span: 16 },
    };
    const tailLayout = {
      wrapperCol: { offset: 8, span: 16 },
    };

    return (
      <PageHeaderWrapper title="用户须知弹窗设置">
      <Card bordered={false}>
        <Form
          {...layout}
          name="basic"
          // onFinish={onFinish}
          // onFinishFailed={onFinishFailed}
        >
          <Form.Item label={'用户须知弹窗设置'}>
            <Button type="primary" htmlType="submit" onClick={this.resetOrderModal}>
              重置
            </Button>
          </Form.Item>
        </Form>
      </Card>
      </PageHeaderWrapper>

    )
  }
}
export default UserModel
